from common.my_file import MyFile
from webdriver_beijiaosuo_jianguan import *
from webdriver_beijiaosuo_wenxun import *
from webdriver_shangjiaosuo_jianguan import *
from webdriver_shangjiaosuo_stock import *
from webdriver_shenjiaosuo_chufen import *
from webdriver_shenjiaosuo_jianguan import *


import os

if __name__ == '__main__':
    lock_file = open('./out/' + os.path.split(__file__)[-1].split(".")[0] + ".lock", 'a', encoding = 'utf-8')
    if False == MyFile.lock_file(lock_file):
        quit()
        
    log_file = open('./out/' + os.path.split(__file__)[-1].split(".")[0] + ".log", 'a', encoding = 'utf-8')
    
    MyFile.wrtie_log(log_file, "北交所监管数据")
    beijiaosuo_jianguan_api()
    MyFile.wrtie_log(log_file, "北交所问询数据")
    beijiaosuo_wenxun_api()
    MyFile.wrtie_log(log_file, "上交所监管数据")
    shangjiaosuo_jianguan_api()
    MyFile.wrtie_log(log_file, "上交所股票数据")
    shanghai_stock_api()
    MyFile.wrtie_log(log_file, "深交所处分数据")
    shenjiaosuo_chufen_api()
    MyFile.wrtie_log(log_file, "深交所监管数据")
    shenjiaosuo_jianguan_api()
    
    log_file.close()
    lock_file.close()